import java.util.Scanner;

public class Fibonacci {
    //求斐波那契数列的第n项。(迭代实现)
    public static int fib(int n) {
        int a = 1, b = 1, c = 0;
        while (n >= 3) {
            c = a + b;
            a = b;
            b = c;
            n--;
        }
        return c;
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入你要求的项数：");
        int n = scan.nextInt();
        int ret = fib(n);
        System.out.println(ret);
    }
}
